package com.competition.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.competition.entity.ProductCart;
import com.competition.entity.ProductCartDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductCartMapper extends BaseMapper<ProductCart> {


    @Select("SELECT * FROM `product_cart` pc join product p on pc.product_id = p.product_id where user_id = #{userId}")
    List<ProductCartDto> selectAllByUserId(@Param("userId") String userId);
}
